package com.thinkit.bigdata.web.dao.sec;

import com.thinkit.bigdata.core.feature.orm.mybatis.Page;
import com.thinkit.bigdata.web.model.sec.QcRelationDto;
import com.thinkit.bigdata.web.model.sec.SysGroup;
import com.thinkit.bigdata.web.model.sec.User;
import com.thinkit.bigdata.web.model.sec.UserExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SysUserMapper {
    int countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    List<User> selectByExample(Page<User> page, UserExample example);

    User selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByExampleForCron(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User authentication(User record);

    Integer deleteUserRoleRefInfo(Long userId);

    Integer insertUserRoleRefInfo(User record);

    Integer batchDeleteUserRoleRefInfo(@Param("idList") List<Long> idList);

    QcRelationDto selectedSeat(Long userId);

    Integer deleteQcRelation(QcRelationDto qcRelation);

    Integer insertQcRelation(QcRelationDto qcRelation);

    List<User> selectUserByAreaId(Long areaId);

    List<User> selectSeatIdByAread(@Param("code") String code);

    List<Map<String, Object>> selectAccountByAreaGroupId(@Param("areaId") Long areaId, @Param("seatGroupId")Long seatGroupId);

    List<User> selectSeatIdByQc(@Param("userId") Long userId, @Param("groupId") Long groupId);

    // 根据质检人员id 查询出质检人员所管辖的坐席组信息
    List<SysGroup> selectManagedSeatGroupByUserId(Long userId);

    // 查询所有坐席
    List<Map<String, Object>> selectAllSeat();

    // 查询不同页面的创建人信息
    List<Map<String, Object>> selectCreateUser(Map<String, Object> params);

    Integer updateInitPasswordByPrimaryKey(User user);

    // 根据角色id查询用户id
    List<Long> selectUserIdByRoleId(@Param("roleIdList") List<Long> roleIdList);

    // 根据id查询用户信息
    List<User> selectUserListById(@Param("userId") List<Long> userIdList);

}